import ROUTES from './routes'
import core from './core'

export default class ios extends core {
    constructor() {
        super()
    }
    defineFunc() {
        super.defineFunc()
        Object.keys(ROUTES).forEach(key => {
            window.TongBridge.paths[key] = ROUTES[key].ios
        })
        const { safeBottom, safeTop, user, appVersion, bridgeVersion } = JSON.parse(TongBridge.getClientInfo())
        window.TongBridge.clientInfo = {
            user,
            safeBottom: Number(safeBottom),
            safeTop: Number(safeTop),
            appVersion,
            bridgeVersion: bridgeVersion || 0,
        }
        window.TongBridge.skipGroupSquare = () => {
            TongBridge.routeTo && TongBridge.routeTo(JSON.stringify({
                path: "TT://TTChat/groupSquare",
            }))
        }
    }
}